The present invention relates generally to computer systems and more particularly to client controlled pre-fetching of resources in computer systems.
In conventional systems, users must often wait a significant period of time between when the users request web pages from web servers and when the users receive the web pages. As a result, some conventional systems have begun to employ caches. Each cache holds selected web pages and is able to return the selected web pages to the users more quickly than the web servers that hold the web pages. When a user wishes to obtain a copy of a selected web page, a cache is checked to determine whether a web page with a matching uniform resource locator (URL) is resident within the cache. If no matching web page is resident within the cache, a request is sent to a remote web server to obtain a copy of the web page.
The resulting increase in performance due to the use of caching is largely dependent upon what web pages are cached. Numerous conventional approaches have been devised for xe2x80x9cpre-fetchingxe2x80x9d web pages in anticipation that the user will next request the web pages that are pre-fetched. For example, in some conventional systems, when a web page is retrieved from a web server, all of the web pages referenced by hyperlinks within the retrieved web page are pre-fetched for storage within the cache. Other conventional systems pre-fetch web pages resident on the same web site as the web page that was most recently retrieved.
Unfortunately, the pre-fetching strategies of conventional systems have not predicted user activity well. In other words, with such strategies, web pages have been pre-fetched that are not of interest to the user. This results in unnecessary overhead, the waste of precious cache space and unnecessary traffic and congestion. This problem is especially magnified when a significant number of web pages or very large web pages are pre-fetched. An additional problem with conventional systems is that web pages may be pre-fetched that are already resident within the cache. Still further, web pages of small size may be pre-fetched; hence, the caching results in only a minimum overhead savings or even an overhead loss.
The present invention addresses the above-described limitations of conventional systems. In particular, the present invention provides client controlled pre-fetching of identifying function values for resources and/or resources for a cache. The resources may be, for example, web pages, audio content, video content, data files or even computer programs. The client may control pre-fetching based upon a number of different criteria. For example, an identifying property value may be examined for a desired resource to determine whether a copy of the resource is already resident within the cache. The identifying property value is intrinsically tied to the contents of the resource so that resources with different names, addresses or URLs may be compared to determine if they have the same content. Information regarding the size of a resource may be obtained prior to pre-fetching the resource to determine whether the resource is of sufficient size to result in a significant enough savings to warrant pre-fetching. Other criteria, such as statistical information, historical information, state of the network and the like, may be used as part of the decision to determine whether to pre-fetch a resource or not.
In accordance with one aspect of the present invention, a selected identifying property value for a selected resource is obtained in an electronic device, such as a computer system, that has a cache for caching resources. The selected identifying property value is compared with identifying property values for the resources in the cache to determine whether the selected resource is resident within the cache. Where the selected resource is not resident within the cache, the selected resource is pre-fetched to obtain and store a copy of the selected resource in the cache. In the case where the selected resource is determined to be resident in the cache, the pre-fetching of the selected resource may be prevented. The resource may be a web page, for example. The identifying property value may be a hash function value that is calculated by applying a hash function to the respective resources. This method may be performed by a proxy or a web browser.
In accordance with another aspect of the present invention, information regarding a selected resource is requested by a device that has a cache for caching resources. An identifying property value for the selected resource and information regarding the size of the selected resource are received in response to the request. Where the size of the selected resource fails to exceed a threshold, the selected resource is not pre-fetched. Where the selected resource exceeds the threshold, the identifying property value may be used to determine whether the selected resource is already resident within the cache. If the selected resource is already resident in the cache, pre-fetching of the selected resource is prevented. In contrast, where it is determined that the selected resource is not already resident in the cache, the pre-fetching of the selected resource may be initiated.
In accordance with an additional aspect of the present invention, a method is practiced in a device that has a cache for caching resources. In accordance with this method, a selected value is obtained for a selected resource. The selected value is intrinsically tied to the contents of the resource so as to identify the resource. Based on the selected value, it is determined whether the selected resource is already resident in the cache. If it is determined that the selected resource is not already resident in the cache, a check is made whether an additional criteria is met. If the additional criteria is met and it is determined that the selected resource is not already resident in the cache, the selected resource is pre-fetched. The additional criteria may be that the resource is of a size that is large enough to warrant pre-fetching.